package com.example.maven.controller;


import com.example.maven.service.Service;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Slf4j
public class Controller {

    @Autowired
    private Service service;

    @GetMapping("/")
    public String getMessage(){
        log.info("This is an info log message.");
        log.debug("This is a debug log message.");
        log.error("This is an error log message.");
        return service.getMessage();
    }

    @GetMapping("/test")
    public String getTestMessage(){
        return service.getMessage() + "test";
    }
}
